+2007-01-16 Michael Schumacher <schumaml@cvs.gnome.org>
+
+ * configure.ac: remove the check for dlopen again - didn't work as
+ intended
+ * babl/babl-extension.c: for #idfef WIN32, #define dl* functions
+ to their Windows equivalents (LoadLibrary, GetProcAddress,
+ FreeLibrary).
+
2007-01-08 Øyvind Kolås <pippin@gimp.org>
* babl/babl-extension.c: define HAVE_DLOPEN if HAVE_DLFCN is set.
#ifdef HAVE_CONFIG_H
#include "config.h"
-
-#ifdef HAVE_DLFCN_H
-#ifndef HAVE_DLOPEN
-#define HAVE_DLOPEN 1
-#endif
-#endif
-
-
#else
#define BABL_PATH PREFIX "/babl-0.0"
#define BABL_PATH_SEPERATOR "/"
#define BABL_LIST_SEPERATOR ':'
#endif
-
-
#define BABL_INIT_HOOK init_hook();
#define BABL_DESTROY_HOOK destroy_hook();
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
+#define HLIB void *
#endif
#ifndef RTLD_NOW
#define RTLD_NOW 0
#endif
+#ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#define HLIB HINSTANCE
+
+#define dlopen(a, b) LoadLibrary(a)
+#define dlsym(l, s) GetProcAddress(l, s)
+#define dlclose(l) FreeLibrary(l)
+#define dlerror() GetLastError()
+#endif
+
static Babl *
load_failed (Babl *babl)
{
babl_extension_load (const char *path)
{
Babl *babl = NULL;
-
-#ifdef HAVE_DLOPEN
/* do the actual loading thing */
- void *dl_handle = NULL;
+ HLIB dl_handle = NULL;
int (*init) (void) = NULL;
void (*destroy) (void) = NULL;
babl_log ("babl_extension_init() in extension '%s' failed (return!=0)", path);
return load_failed (babl);
}
-#endif
if (babl_db_insert (db, babl) == babl)
{
{
if (babl->extension.destroy)
babl->extension.destroy();
-#ifdef HAVE_DLOPEN
if (babl->extension.dl_handle)
dlclose (babl->extension.dl_handle);
-#endif
babl_free (babl);
return 0; /* continue iterating */
AC_CHECK_LIB([dl], [dlopen], [DL_LIB="-ldl"])
AC_SUBST(DL_LIB)
-AC_CHECK_FUNCS(dlopen)
AC_REPLACE_FUNCS(gettimeofday)
AC_DEFINE_UNQUOTED(BABL_PATH, "~/.babl-$BABL_API_VERSION:/usr/local/lib/babl-$BABL_API_VERSION:/usr/lib/babl-$BABL_API_VERSION", [search path for babl extensions (default value of enviroment variable)])